﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace TouchControls.ControlHandlers
{
    public class TouchImageHandler : ElementHandler
    {
        public override void Tap(System.Drawing.PointF global, System.Drawing.PointF relative)
        {
            var c = Source as Image;
            if (c == null) return;
            var e = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left) { RoutedEvent = Image.MouseLeftButtonDownEvent };
            c.RaiseEvent(e);
            base.Tap(global, relative);
        }
    }
}
